<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="/static/style.css">
    <link rel="shortcut icon" type="image/vnd.microsoft.icon" href="https://avatar.moonshot.cn/avatar/cmri3mecp7fdvr21ch3g" />
    <title>LED Control</title>
    <style>
        body {
            background-color: {% if current_state == 1 %} white {% else %} black {% endif %};
        }
        .clickable {
            cursor: pointer;
        }
    </style>
</head>
<body>
    <h1>LED-{{ mac }}控制页</h1>
    <div class="center">

        {% if current_state == 1 %}
            <p class="state">当前状态：开</p>
            <form method="post" action="/LEDcontrol/{{ mac }}" class="clickable" style="display: inline;">
                <button type="submit" name="buttonState" value="{{ 0 }}" style="background: none; border: none;">
{#                    <img src="/static/led_on.svg" alt="LED On">#}
                    <img src="/static/led_on.png" alt="LED Off" style="width: 100px;">
                </button>
            </form>
        {% else %}
            <p class="state">当前状态：关</p>
            <form method="post" action="/LEDcontrol/{{ mac }}" class="clickable" style="display: inline;">
                <button type="submit" name="buttonState" value="{{ 1 }}" style="background: none; border: none;">
{#                    <img src="/static/led_off.svg" alt="LED Off">#}
                    <img src="/static/led_off.png" alt="LED On" style="width: 100px;">
                </button>
            </form>
        {% endif %}

        <form method="post" action="/LEDcontrol/{{ mac }}">
            <button type="submit" name="buttonState" value="{{ 1-current_state }}">{{ button_text }}</button>
        </form>
    </div>
</body>
</html>
